[HVM] fix system crash when vmx guest startx or restore
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 14 Jul 2006 12:59:53 +0000 (13:59 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 14 Jul 2006 12:59:53 +0000 (13:59 +0100)
Add this safety check like alloc_l4_table
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
xen/arch/x86/mm.c

index b2c95c1c9b582ab2f2450b361b8b56db399803ca..20a7e125cd17825e6c136c525621c5f2de02c21f 100644 (file)
@@ -1008,6 +1008,10 @@ static int alloc_l3_table(struct page_info *page, unsigned long type)
     l3_pgentry_t  *pl3e;
     int            i;
 
+    /* See the code in shadow_promote() to understand why this is here. */
+    if ( (PGT_base_page_table == PGT_l3_page_table) &&
+         shadow_mode_refcounts(d) )
+        return 1;
     ASSERT(!shadow_mode_refcounts(d));
 
 #ifdef CONFIG_X86_PAE